package com.tanhua.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.db.AnalysisByDay;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {

    // 累计用户
    @Select("SELECT SUM(num_registered) FROM `tb_analysis_by_day`")
    Long selectCumulativeUsers();


    // 指定日期范围，查询活跃用户数
    @Select("SELECT SUM(num_active) FROM `tb_analysis_by_day` WHERE record_date BETWEEN #{startDate} AND #{endDate}")
    Long selectNumActive(@Param("startDate") String startDate,@Param("endDate") String endDate);

}